//
// Created by zhenduowang on 2020/9/14.
//

#include <stdio.h>
#include <stdlib.h>
#include "config.h"

#ifdef USE_MYMATH
#include "math/MathTools.h"
#else
#include <math.h>
#endif


int main(int argc, char *argv[])
{
    printf("Version %d.%d\n",
           Demo_VERSION_MAJOR,
           Demo_VERSION_MINOR);
    if (argc < 3){
        printf("Usage: %s base exponent \n", argv[0]);
        return 1;
    }
    double base = atof(argv[1]);
    int exponent = atoi(argv[2]);

#ifdef USE_MYMATH
    printf("Now we use our own Math library. \n");
    double result = power(base, exponent);
#else
    printf("Now we use the standard library. \n");
    double result = pow(base, exponent);
#endif
    printf("%g ^ %d is %g\n", base, exponent, result);
    return 0;
}